home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1988 / Jul 88 / TEView Response.pr < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.7 KB  |  49 lines  |  [TEXT/GEOL]

  1.  
  2. Sorry about interjecting a technical thought in the midst of a legalese
  3. barrage, but here is a reply to replies to my question.
  4.  
  5. Thanks for replies to my previous question about having multiple TEViews nested
  6. inside a CatView.  I decided to use a variation on the idea that Larry
  7. Rosenstein proposed.  I kept the idea of really only having one TEView which
  8. heartily speeded several operations.  The only involved part was switching from
  9. the current TEView location to the new location.  Notes on the implementation:
  10.  
  11.  
  12. I keep a list of rectangles where my TEViews can be.
  13. On a mouse down in my CatView I determine the TEView rectangle index.
  14.  
  15. IF i <> gCurrBoxNum THEN                        {If Rectangle Index <> Current
  16. Index}
  17. BEGIN
  18. TEDeactivate(gExptDocument.fTEView.fHTE);   {Deactivate the TEView for
  19. update purposes}
  20. gCurrBoxNum := i;                           {Assign Current Index}
  21.  
  22. {Copy the TE text to a storage list through a global variable}
  23. GetIText(gExptDocument.fTEView.fHTE^^.hText, MyString);
  24. gCurrIOBox.fTitle := MyString;
  25.  
  26. {Set the TE text to the string of the new text area}
  27. TESetText(@aIOBox.fTitle[1], Length(aIOBox.fTitle),
  28. gExptDocument.fTEView.fHTE);
  29.  
  30. r := aIOBox.flocation;                           {Change the extent rect of
  31. TE View}
  32. gExptDocument.fTEView.SetExtent(r);
  33.  
  34. ValidRect(gExptDocument.fExptView.fExtentRect);  {Avoid uneeded flicker}
  35. gCurrIOBox := aIOBox;                            {Assign global variable}
  36. TEActivate(gExptDocument.fTEView.fHTE);          {Reactivate the TE}
  37. END;
  38.  
  39.  
  40. You need to remember to draw the current TE View in the .Draw routine
  41. separately to ensure it is up to date, and to save the current TE View upon a
  42. Save command.
  43.  
  44. Keith Bossert
  45. Software Development Group
  46. Drexel University
  47.  
  48.  
  49.